(*  :Title:	Initialization for Object-Oriented Signal Processing Package  *)

(*  :Authors:	Brian Evans, James McClellan  *)

(*  :Summary:	This is an initialization file only  *)

(*  :Context:	Global`  *)

(*  :PackageVersion:  2.74	*)

(*
    :Copyright:	Copyright 1989-1992 by Brian L. Evans
		Georgia Tech Research Corporation

	Permission to use, copy, modify, and distribute this software
	and its documentation for any purpose and without fee is
	hereby granted, provided that the above copyright notice
	appear in all copies and that both that copyright notice and
	this permission notice appear in supporting documentation,
	and that the name of Georgia Tech or Georgia Institute of
	Technology not be used in advertising or publicity pertaining
	to distribution of the software without specific, written prior
	permission.  Georgia Tech makes no representations about the
	suitability of this software for any purpose.  It is provided
	"as is" without express or implied warranty.
 *)

(*  :History:	*)

(*  :Keywords:	*)

(*  :Source:	*)

(*  :Warning:	*)

(*  :Mathematica Version:  1.2 or 2.0  *)

(*  :Limitation:  *)


(*  B E G I N     I N I T I A L I Z A T I O N  *)


(*  Load those routines on which these packages rely  *) 

Needs[ "SignalProcessing`Support`" ]


Which [


(*  Check to make sure that these packages has not already been loaded  *)

MemberQ[ $ContextPath, "SignalProcessing`ObjectOriented`" ],

  object::loaded =
	"Version 2.74 of the property and rewrite rules for \
        signals and systems has already been loaded.",


(*  For Mathematica 2.0, we only define the stubs  *)

TrueQ[ $VersionNumber >= 2.0 ],

  Print["Defining stubs for version 2.74 of the \
           property and rewrite rules for signals and systems." ];

  DeclarePackage[ "SignalProcessing`ObjectOriented`Heuristics`", { 
			"SPHeuristicRewrite", "SPRecursiveRewrite" } ];

  DeclarePackage[ "SignalProcessing`ObjectOriented`RewriteRules`", { 
			"SystemRewriteRules" } ];

  DeclarePackage[ "SignalProcessing`ObjectOriented`Signal`", { 
			"ArraySignal", "ArraySignalQ", "CenterOfSymmetry",
			"ComputableSignalQ", "DiscreteTimeSignalQ",
			"EndBandwith", "Fetch", "FetchArray", "FetchNext",
			"IIRCoefficients", "IndependentVariable",
			"IIRFilter", "IIRPostUpdate", "MakeContinuousSignal",
			"MakeDigitalSignal", "MakeSignal", "MyMakeSignal",
			"NextFun", "OutOfDomainValue", "PastValues",
			"PointwiseSignal", "PointwiseSignalQ",
			"PostUpdateFunction", "PreUpdateFunction", "PrintName",
			"RealOrComplex", "Self", "Signal", "SignalQ",
			"StartBandwith", "StreamSignal", "StreamSignalQ" } ];

  DeclarePackage[ "SignalProcessing`ObjectOriented`Slot`", { 
			"AddSlot", "AppendSlot", "DefaultSlot",
			"DefineObjectType", "DeleteSlot", "HasSlotQ",
			"MakeObject", "ReadOnlyList", "ReadOnlySlotQ",
			"ReadSlot", "WriteSlot" } ];

  DeclarePackage[ "SignalProcessing`ObjectOriented`StackQueue`", { 
			"ClearQueue", "ClearStack", "Dequeue", "Enqueue",
			"Pop", "Push", "Queue", "TopElement" } ];

  DeclarePackage[ "SignalProcessing`ObjectOriented`System`", { 
			"ASSOCIATIVE", "ADDITIVE", "COMMUTATIVE", "CONTINUOUS",
			"DefineSystem", "DISCRETE", "HOMOGENEOUS", "LINEAR",
			"LINEARPHASE", "MEMORYLESS", "MoveOperatorsToFront",
			"SEPARABLE", "SHIFTINVARIANT", "SystemProperties",
			"SPsystems", "SPproperties", "SystemQ",
			"ValidOperatorQ" } ];

  AppendTo[$ContextPath, "SignalProcessing`ObjectOriented`"];

  object::loaded =
	"Stubs for the routines, objects, and rules for the object signal \
	processing package have been loaded successfully.",


(*  Object-oriented signal processing --  load in hierarchial order. *)

True,

  Print[ "Loading version 2.74 of property and rewrite rules for \
            signals and systems." ];

  Needs[ "SignalProcessing`ObjectOriented`StackQueue`" ];	(* level a *)
  Needs[ "SignalProcessing`ObjectOriented`Slot`" ];

  Needs[ "SignalProcessing`ObjectOriented`System`" ];		(* level b *)
  Needs[ "SignalProcessing`ObjectOriented`RewriteRules`" ];

  Needs[ "SignalProcessing`ObjectOriented`Signal`" ];		(* level c *)

  AppendTo[$ContextPath, "SignalProcessing`ObjectOriented`"];

  object::loaded =
	"Routines, objects, and rules for the object signal \
	processing package have been loaded successfully."

]


(*  Temporary messages  *)

object::error = "The current context should be Global` and it is not."

(*  Error checking  *)

If [ SameQ[$Context, "Global`"],
     Message[ object::loaded ],
     Message[ object::error ] ]

(*  Remove temporary messages  *)

object::error = .
object::loaded = .


(*  E N D     I N I T I A L I Z A T I O N  *)

Null
